const express = require("express");
const noteRouter = express.Router();
const noteController = require("../controllers/note");
const upload = require("../utils/multer");

// 新增留言/照片
noteRouter.post("/addNote", upload.single("file"), noteController.addNote);
// 删除留言/照片
noteRouter.delete("/deleteNote", noteController.deleteNote);
// 获取留言/照片列表
noteRouter.get("/getNoteList", noteController.getNoteList);
// 获取留言/照片
noteRouter.get("/getNote", noteController.getNote);
// 新增反馈
noteRouter.post("/addFeedback", noteController.addFeedback);
// 获取反馈列表
noteRouter.get("/getFeedbackList", noteController.getFeedbackList);
// 删除反馈
noteRouter.delete("/deleteFeedback", noteController.deleteFeedback);
// 新增评论
noteRouter.post("/addComment", noteController.addComment);
// 获取评论列表
noteRouter.get("/getCommentList", noteController.getCommentList);
// 删除评论
noteRouter.delete("/deleteComment", noteController.deleteComment);
// 是否反馈
noteRouter.get("/isFeedback", noteController.isFeedback);
/** 上传图片 */
noteRouter.post("/upload", upload.single("file"), noteController.upload);

module.exports = noteRouter;
